import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';

export class RegisterUserDto {
  @ApiProperty({
    description: '用户名 唯一',
    example: 'admin',
  })
  @IsNotEmpty({ message: '请输入用户名' })
  readonly username: string;

  @ApiProperty({ description: '昵称', example: '斯提芬大狗' })
  @IsNotEmpty({ message: '请输入用户昵称' })
  @IsString({ message: '名字必须是 String 类型' })
  readonly nickname: string;

  @ApiProperty({
    description: '用户密码',
    example: 'a123123123',
  })
  @IsNotEmpty({ message: '请输入密码' })
  readonly password: string;

  @ApiProperty({
    description: '二次输入密码',
    example: 'a123123123',
  })
  @IsNotEmpty({ message: '请再次输入密码' })
  readonly passwordRepeat: string;
}
